<%@ page import="java.util.ArrayList" %>
<%@ page import="com.xiaoyu.pojo.Person" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="static/css/search.css">
</head>
<body>
    <div class="container">
        <div class="clearfix">
            <div class="left">
                <form action="${pageContext.request.contextPath}/searchPerson" method="post">
                    <input type="text" placeholder="请输入" name="input">
                    <input type="submit">
                </form>
            </div>
            <div class="right">
                <a href="page.jsp"><button>返回</button></a>
            </div>
        </div>
        <div class="table">
            <table id="table">
                <tr>
                    <th>name</th>
                    <th>Sex</th>
                    <th>Age</th>
                    <th>Phone</th>
                </tr>
                <%
                    ArrayList<Person> result=(ArrayList<Person>)request.getAttribute("result");
                    if (result == null || result.size() < 1) {
                        out.print("没有数据！");
                    } else {
                        for (Person person : result) {
                %>
                <tr>
                    <td><%=person.getName()%></td>
                    <td><%=person.getSex()%></td>
                    <td><%=person.getAge()%></td>
                    <td><%=person.getPhone()%></td>
                </tr>
                <%
                        }
                    }
                %>
            </table>
        </div>
    </div>
</body>
</html>
